package com.bentley.kotlindemo.utils

import android.app.AlertDialog
import com.bentley.kotlindemo.App

/**
 * <pre>
 *  ┌────────────────────────────────────────────
 *  │ @author  Lee  @date 2021/3/16 16:21
 *  ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
 *  │ @desc
 *  └────────────────────────────────────────────
 * </pre>
 */
class DialogUtils {
//     val loading:AlertDialog = AlertDialog.Builder(App.INSTANCE)
//    builder.setTitle("加载中...")
//    builder.setMessage("加载中...")
//}

    companion object {
        private var mRetrofitFactory: AlertDialog? = null
            get() {
                if (field == null) {
                    synchronized(DialogUtils::class.java) {
                        if (field == null) {
                            field = AlertDialog
                                .Builder(App.INSTANCE)
                                .setTitle("加载中...")
                                .setMessage("加载中...")
                                .create()
                        }
                    }
                }
                return field!!
            }

        fun getInstence(): AlertDialog {
            return mRetrofitFactory!!
        }
    }
}